﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace condortravel.operaciones.common 
{
    public class Impersonate:Bansud.SGR.CommonSGR.Impersonate,IDisposable
    {
        #region Attributes
        private string user;
        private string password;
        private string domain;
        
        #endregion

        #region Properties
        public string User
        {
            get { return user; }
            set { user = value; }
        }


        public string Password
        {
            get { return password; }
            set { password = value; }
        }


        public string Domain
        {
            get { return domain; }
            set { domain = value; }
        }

        #endregion

        #region Constructor
        public Impersonate(string user, string password, string domain)
        {
            this.User = user;
            this.Password = password;
            this.Domain = domain;
        }
        public Impersonate()
        { 
        
        }
        #endregion

        #region Public Methods

        public void UndoImpersonation()
        {            
            this.undoImpersonation();            
        }
        public bool ToImpersonate()
        {
            bool result = false;            
            result = this.impersonateValidUser(this.User, this.Domain, this.Password);
            return result;
        }
        #endregion



        #region IDisposable Members

        public void Dispose()
        {
            
        }

        #endregion
    }
}
